//===COMMENT===

package bubble3d.rendering {

	public class Material {

		import bubbletools.util.UnitConversion;

		// numerical values 0-255

		private var diffuseR:Number;
		private var diffuseG:Number;
		private var diffuseB:Number;

		// hexideciaml value

		private var diffuseHex:Number;

		public function Material() {
		}

		public function setDiffuseValues(diffuseR:Number, diffuseG:Number, diffuseB:Number):void {
			this.diffuseR = diffuseR;
			this.diffuseG = diffuseG;
			this.diffuseB = diffuseB;

			var dRHex:String = UnitConversion.decimalToHex(diffuseR);
			var dGHex:String = UnitConversion.decimalToHex(diffuseG);
			var dBHex:String = UnitConversion.decimalToHex(diffuseB);
			var diffuseStr:String = "0x" + dRHex + dGHex + dBHex;

			diffuseHex = parseInt(diffuseStr, 16);
		}

		public function dR():Number {
			return (diffuseR);
		}

		public function dG():Number {
			return (diffuseG);
		}

		public function dB():Number {
			return (diffuseB);
		}

		public function diffuse():Number {
			return (diffuseHex);
		}
	}

}
